home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / vbcc-ppc-src / ar / append.c < prev    next >
C/C++ Source or Header  |  1999-01-01  |  1KB  |  56 lines

  1. /* $VER: ar append.c V0.1 (31.01.98)
  2.  *
  3.  * This file is part of ar, a portable archive maintanance
  4.  * utility for normal and BSD-style archives.
  5.  * Copyright (c) 1999  Frank Wille
  6.  *
  7.  * ar is freeware and part of the portable and retargetable ANSI C
  8.  * compiler vbcc, copyright (c) 1995-99 by Volker Barthelmann.
  9.  * ar may be freely redistributed as long as no modifications are
  10.  * made and nothing is charged for it. Non-commercial usage is allowed
  11.  * without any restrictions.
  12.  * EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
  13.  * SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
  14.  *
  15.  *
  16.  * v0.1  (31.01.99) phx
  17.  *       First working version, which only supports 'q' (quick append)
  18.  *       and 't' (table of contents), reads and writes normals and
  19.  *       BSD-style archives. Symbol table will not be created!
  20.  * v0.0  (30.01.99) phx
  21.  *       File created.
  22.  */
  23.  
  24. #include <stdio.h>
  25. #include "ar.h"
  26. #include "archive.h"
  27.  
  28.  
  29.  
  30. void ar_move(struct Args *args)
  31. {
  32. }
  33.  
  34.  
  35. void ar_qappend(struct Args *args)
  36. {
  37.   struct Archive *ar;
  38.   struct ArObject *obj;
  39.   uint32 i;
  40.  
  41.   if (ar = ar_readorcreate(args->arname,args->modifier)) {
  42.     for (i=0; i<args->filecnt; i++) {
  43.       if (obj = ar_newmemb(args->files[i])) {
  44.         /* quick append, without checking archive */
  45.         addtail(&ar->l,&obj->n);
  46.         ar->entries++;
  47.         if (args->modifier & AR_VERBOSE)
  48.           printf("q - %s\n",obj->name);
  49.       }
  50.       else
  51.         return;
  52.     }
  53.     ar_write(ar,args->modifier);
  54.   }
  55. }
  56.